//
//  LGSchedulHomeConsultCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/2/28.
//

#import "LGSchedulHomeConsultCell.h"

@interface LGSchedulHomeConsultCell()
/**   */
@property (nonatomic , strong)UIView *baseView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;
/**   */
@property (nonatomic , strong)UIImageView *tipView;

@end

@implementation LGSchedulHomeConsultCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return  self;
}


-(void)setDataDic:(NSDictionary *)dataDic{
    _dataDic = dataDic;
    self.titleLabel.text = dataDic[@"title"];
}

-(void)createSubView{
    self.clipsToBounds = YES;
    self.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
    self.contentView.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
    [self.contentView addSubview:self.baseView];
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.contentLabel];
    [self.contentView addSubview:self.tipView];
    [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(self.contentView).offset(viewPix(16));
        make.top.right.equalTo(self.contentView).offset(-viewPix(16));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(viewPix(6));
        make.bottom.equalTo(self.contentView).offset(-viewPix(6));
        make.left.equalTo(self.contentView).offset(viewPix(28));
        make.right.equalTo(self.contentLabel.mas_left).offset(-viewPix(10));
//        make.width.equalTo(@(viewPix(180)));
    }];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.tipView.mas_left);
        make.centerY.equalTo(self.titleLabel);
    }];
    [self.tipView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-viewPix(28));
        make.centerY.equalTo(self.titleLabel);
        make.width.height.equalTo(@(viewPix(12)));
    }];
}

-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.15 radius:15];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"团队名称" colorString:@"#666666" textFont:LGFont(16) textAlignment:NSTextAlignmentLeft lines:2];
    }
    return _titleLabel;
}

-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"30条/48小时" colorString:@"#666666" textFont:LGFont(16) textAlignment:NSTextAlignmentRight lines:1];
    }
    return _contentLabel;
}

-(UIImageView *)tipView{
    if(!_tipView){
        _tipView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"grayTip12"]];
    }
    return _tipView;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
